package com.tree.rpc.netty.consumer.proxy;

import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * @ClassName com.tree.rpc.netty.consumer.proxy
 * Description: <类功能描述>. <br>
 * <p>
 * <使用说明>
 * </p>
 * @Author tree
 * @Date 2019-11-06 22:22
 * @Version 1.0
 */
public class RpcProxyHandler extends ChannelHandlerAdapter {

    private Object result;

    public Object getResult(){
        return this.result;
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        cause.printStackTrace();
    }

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        result = msg;
    }
}
